#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int m;
int e[N], l[N], r[N], idx;

void init() {
	r[0] = 1;
	l[1] = 0;
	idx = 2;
}

void insert(int a, int x) {
	e[idx] = x;
	l[idx] = a, r[idx] = r[a];
	l[r[a]] = idx, r[a] = idx++;
}

void remove(int a) {
	l[r[a]] = l[a];
	r[l[a]] = r[a];
}

int main() {
	cin >> m;
	init();
	while (m--) {

	}
	return 0;
}